Skip to content

Remove axios dependency and replace with native fetch in web-ui#7386

Closed
aajisaka wants to merge 4 commits intoapache:masterfrom
aajisaka:remove-axios
Closed

Remove axios dependency and replace with native fetch in web-ui#7386
aajisaka wants to merge 4 commits intoapache:masterfrom
aajisaka:remove-axios

Conversation

@aajisaka
Copy link
Copy Markdown
Member

@aajisaka aajisaka commented Apr 6, 2026

Why are the changes needed?

Replace axios with the native Fetch API in request.ts, removing the axios dependency from package.json. Reducing the dependent libraries to reduce the possibility of supply chain attack and to reduce future maintenance cost. Enforce Node.js >=18 via the engines field and update README accordingly.

How was this patch tested?

Covered by the existing unit tests.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.6)

@github-actions github-actions Bot added kind:infra license, community building, project builds, asf infra related, etc. module:ui labels Apr 6, 2026
@aajisaka
Copy link
Copy Markdown
Member Author

Thank you @pan3793. Addressed the review comments.

aajisaka and others added 3 commits April 21, 2026 20:21
Replace axios with the native Fetch API in request.ts, removing the
axios dependency from package.json. Enforce Node.js >=18 via the
engines field and update README accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- api/v1/ping returns text/plain 'pong'; returning undefined for non-JSON
  responses caused useAuthStore.setUser to always throw 'Authentication failed'.
  Now return the text body when non-JSON.
- On non-2xx responses, read the body and attach it as err.response = { status, data }
  so existing callers (e.g. Editor.vue) can surface the server-provided message
  via err.response.data.message, matching the previous axios shape.
@pan3793 pan3793 added this to the v1.12.0 milestone Apr 21, 2026
@pan3793
Copy link
Copy Markdown
Member

pan3793 commented Apr 21, 2026

verified locally, thanks, merged to master

@pan3793 pan3793 closed this in a9b2123 Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:infra license, community building, project builds, asf infra related, etc. module:ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants